﻿package fj.ui
{
	import flash.display.MovieClip;
	
	public class FJImageTransformHandlers extends MovieClip
	{
		public var rotate_1:MovieClip;
		public var rotate_2:MovieClip;
		public var rotate_3:MovieClip;
		public var rotate_4:MovieClip;
		public var scale_1:MovieClip;
		public var scale_2:MovieClip;
		public var scale_3:MovieClip;
		public var scale_4:MovieClip;
		
		private var _width:Number;
		private var _height:Number;
		
		public function ImageTransformHandlers():void
		{
			rotate_1.x = -105;
			rotate_1.y = -105;
			rotate_2.x = 105;
			rotate_2.y = -105;
			rotate_3.x = 105;
			rotate_3.y = 105;
			rotate_4.x = -105;
			rotate_4.y = 105;
			
			scale_1.x = -100;
			scale_1.y = -100;
			scale_2.x = 100;
			scale_2.y = -100;
			scale_3.x = 100;
			scale_3.y = 100;
			scale_4.x = -100;
			scale_4.y = 100;
			
			move.width = 200;
			move.height = 200;
		}
		public function adjust( w:Number, h:Number ):void
		{
			rotate_1.x = -w/2-5;
			rotate_1.y = -h/2-5;
			rotate_2.x = w/2+5;
			rotate_2.y = -h/2-5;
			rotate_3.x = w/2+5;
			rotate_3.y = h/2+5;
			rotate_4.x = -w/2-5;
			rotate_4.y = h/2+5;
			
			scale_1.x = -w/2;
			scale_1.y = -h/2;
			scale_2.x = w/2;
			scale_2.y = -h/2;
			scale_3.x = w/2;
			scale_3.y = h/2;
			scale_4.x = -w/2;
			scale_4.y = h/2;
			
			move.width = w;
			move.height = h;
		}
	}
}